package com.isoft.dao.tabledao;


import com.isoft.entity.tableentity.dfme_airl.Arpt;
import com.isoft.entity.tableentity.dfme_airl.DfmeAirlDflt;
import com.isoft.entity.tableentity.dfme_airl.DfmeAirlMeta;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;
@Mapper
public interface DfmeAirlDao {
    @Insert("insert into TEAM04.COMMON_META( create_time, sndr, rcvr, seqn, ddtm, type, styp) " +
            "values( #{create_time}, #{meta.sndr}, #{meta.rcvr}, #{meta.seqn}," +
            " #{meta.ddtm}, #{meta.type}, #{meta.styp})")
    public int insertMeta(@Param("create_time") Timestamp create_time,
                          @Param("meta") DfmeAirlMeta dfmeAirlMeta);

    @Insert("insert into TEAM04.DFME_AIRL(meta_id,create_time,flid,ffid,fide) " +
            "values(#{meta_id},#{create_time},#{dflt.flid},#{dflt.ffid},#{dflt.fide})")
    public int insertDflt(@Param("meta_id") int meta_id,
                          @Param("create_time") Timestamp create_time,
                          @Param("dflt") DfmeAirlDflt dfmeAirlDflt);

    @Insert("insert into TEAM04.DFME_AIRL_ARPT(apno,apcd,fptt,fett,frtt,fplt,felt,frlt,apat,meta_id,create_time)" +
            "values(#{arpt.apno},#{arpt.apcd},#{fptt},#{fett},#{frtt}," +
            "#{fplt},#{felt},#{frlt},#{arpt.apat},#{meta_id},#{create_time})")
    public int insertArpt(@Param("meta_id") int meta_id,
                          @Param("fptt") Timestamp fptt,
                          @Param("fett") Timestamp fett,
                          @Param("frtt") Timestamp frtt,
                          @Param("fplt") Timestamp fplt,
                          @Param("felt") Timestamp felt,
                          @Param("frlt") Timestamp frlt,
                          @Param("create_time") Timestamp create_time,
                          @Param("arpt") Arpt arpt);
}
